﻿//======================================================================
//
//        Copyright (C) 苏州逸仙软件    
//        All rights reserved
//
//        filename : upimage.cs
//        description :
//
//        created by 周济 at 2010/12/21 16:27:03
//        mail:80406241@qq.com
//
//======================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using huaguwang.swfupload;
using System.IO;

namespace huaguwang.hgmanage.test
{
    public partial class upimage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if(Session["file_info"] != null)
            {
                List<Thumbnail> thumbnails = Session["file_info"] as List<Thumbnail>;

                string UploadPath = Server.MapPath("/upload/images");

                foreach(Thumbnail img in thumbnails)
                {
                    FileStream fs = new FileStream(UploadPath + img.ID + ".jpg", FileMode.Create);
                    BinaryWriter bw = new BinaryWriter(fs);
                    bw.Write(img.Data);
                    bw.Close();
                    fs.Close();
                }

                Session.Clear();
            }    

        }
    }
}
